package org.pixelami.twisted.utils
{
	dynamic public class PyTuple extends Array
	{
		public function PyTuple(...elements)
		{
			super();
			//trace("PyTuple elements = "+elements);
			for each(var o:Object in elements)
			{
				//trace("o = "+o);
				super.push(o);
			}

		}
		
		public function unpack(...holders):void
		{
			if(holders.length != this.length) 
				throw Error("PyTuple Error: tuple has "+this.length+" : only "+holders.length+" holders provided");
			
			for(var i:String in holders)
			{
				holders[i] = this[i];
			}
		}
		
		public function append(a:Array):void
		{
			for each(var o:Object in a)
			{
				this.push(o);
			}
		}
		
	}
}